package cn.elricyu.tt.config;

import org.apache.commons.configuration.PropertiesConfiguration;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

import cn.elricyu.tt.util.SystemUtil;

public class RegExConfig {
	private static final Log logger = LogFactory.getLog(RegExConfig.class);

	private static PropertiesConfiguration userConf = null;

	static {
		try {
			userConf = new PropertiesConfiguration(
					SystemUtil.getUserConfigDir() + "regex.ini");
			userConf.setEncoding("GBK");
		} catch (Exception e) {
			logger.fatal(e.getMessage() + SystemUtil.getUserConfigDir()
					+ "regex.ini", e);
		}
	}

	public static String getReg(String key) {
		return userConf.getString(key, "");
	}
}
